/**
 * Author: runlin.tang
 * Creation Time: 2016-06-29.
 * Description:.���页面需要获取路由的mac 和sn
 */
define(['jquery','../../common/ajax/ajax'],
    function($,ajax,getData) {
        function example(){
            ajax({
                url:interfaces.getBondingData.url,
                dataType:interfaces.getBondingData.dataType,
                type:interfaces.getBondingData.type,
                data:{},
                cache:{
                    use:false,
                    name:'',
                    time:10
                },
                isOk:function(data){
                    var datas = '';
                    if(useNetData){
                        datas = data;
                    }else{
                        datas = data.getdatas;
                    }
                    var html = '';
                    var sn = '';
                    var mac = '';
                    var nuller = 0;
                    if(datas.data.route_sn != null){
                        sn = '<span class="getsn">'+datas.data.route_sn+'</span>';
                    }else{
                        sn = '<span class="getsn">未知</span>';
                        nuller = nuller+1;
                    }
                    if(datas.data.route_mac != null){
                        mac = '<span class="getmac">'+datas.data.route_mac+'</span>';
                    }else{
                        mac = '<span class="getmac">未知</span>';
                        nuller = nuller+1;
                    }
                    var htmlser = '';
                    var binds = '';

                    if(nuller>0){

                        htmlser = '<div class="ly-tip fail-tip"><i></i><span>绑定失败，请重新绑定</span></div>';
                        binds = '<div class="com_btn" style="margin-top:1rem;"><a href="javascript:;" class="two-binding">重新绑定</a></div>'
                    }else{

                        binds = '<div class="com_btn" style="margin-top:1rem;"><a href="javascript:;" class="one-binding">一键绑定</a></div>'
                    }


                    html +='<div class="contect-tap"><img src="images/router/ic_navigation_two.png" alt=""></div>';
                    html +='<div class="success-txt"><i>门店名称</i><a href="'+serUrl+'" class="getshopname">'+shopName+'</a></div>';
                    html +='<ul class="success-txt">';
                    html +='<li><i>SN序列号</i>'+sn+'</li>';
                    html +='<li><i>MAC地址</i>'+mac+'</li>';
                    html +='</ul>'+htmlser+binds;


                    $('.webApp-content').html(html);

                }
            });
        }
        return example;
    });